// dllmain.cpp : Implementation of DllMain.

#include "stdafx.h"
#include "resource.h"

CAppModule _Module;

// DLL Entry Point
extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
	if (dwReason == DLL_PROCESS_ATTACH)
	{
#if	defined(_DEBUG) && defined(_WIN32_WINNT) && !defined(_AFX)
		_CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
#endif
		HRESULT hRes = _Module.Init(NULL, hInstance);
		ATLASSERT(SUCCEEDED(hRes));
	}
	else if (dwReason == DLL_PROCESS_DETACH)
		_Module.Term();

	return TRUE;    // ok
}
